<?php $this->load->view("admin/$adminCurrentTemplate/commonHead")?>
	<div class="main-guid"><img src="template/admin/default/images/ico.jpg" align="middle" />修改密码</div>
    <div class="space-4"></div>
    <ul class="main-item"><form name="changepwdForm" id="changepwdForm" method="post" action="<?php echo $phpSelf;?>">
    	<li><div class="guid">原密码：</div><div class="txt"><input type="password" name="oldpwd" id="oldpwd" class="input-txt" /></div></li>
    	<li><div class="guid">新密码：</div><div class="txt"><input type="password" name="newpwd" id="newpwd" class="input-txt" /></div></li>
    	<li><div class="guid">确认新密码：</div><div class="txt"><input type="password" name="renewpwd" id="renewpwd" class="input-txt" /></div></li>
    	<li><div class="guid"> </div><div class="txt"><input type="submit" name="submitBtn" id="submitBtn" value="修 改" /> <input type="reset" name="resetBtn" id="resetBtn" value="重 置" /></div></li>
    </form></ul>
    <div class="space-4"></div>
<?php $this->load->view("admin/$adminCurrentTemplate/commonFoot")?>    
    
<script type="text/javascript">
$(function(){
	$('.position').hide();
	$('#changepwdForm').bind('submit',subForm);
})

var subForm = function(){
	var oldpwd = $.trim($('#oldpwd').val());
	var newpwd = $.trim($('#newpwd').val());
	var renewpwd = $.trim($('#renewpwd').val());
	if(oldpwd.length==0){
		subMess2(188,108,'修改密码错误','<span class="red">对不起，请输入原密码！</span>',$('#oldpwd'));
		return false;
	}
	if(newpwd.length==0){
		subMess2(188,108,'修改密码错误','<span class="red">对不起，请输入新密码！</span>',$('#newpwd'));
		return false;
	}
	if(renewpwd.length==0){
		subMess2(208,108,'修改密码错误','<span class="red">对不起，请再次输入新密码！</span>',$('#renewpwd'));
		return false;
	}
	if(newpwd!=renewpwd){
		subMess2(238,108,'修改密码错误','<span class="red">对不起，两次输入的密码不相同！</span>',$('#newpwd'));
		$('#newpwd').val('');
		$('#renewpwd').val('');
		return false;
	}
	$('#changepwdForm').submit();
}

/**
 * 对话框
 * @param dialogWidth		对话框宽度
 * @param dialogHeight		对话框高度
 * @param dialogTitle		对话框标题
 * @param dialogContent		对话框内容
 * @param focuseObj			单击确定后获取焦点对象
 */
var subMess2 = function(dialogWidth,dialogHeight,dialogTitle,dialogContent,focuseObj){
	var subMessDialog2 = new $.dialog({		
			id:'subMess2',
			width:dialogWidth,
			height:dialogHeight,
			cover: true,
			iconTitle:false,
			xButton:false,
			resize:false,
			rang:true,
			maxBtn:false,
			autoPos:{left:'center',top:'center'},
			cancelBtnTxt:'确定',
			onCancel:function(){
				focuseObj.focus();
			},
			title:dialogTitle,
			html:'<p class="mess-detail">' + dialogContent + '</p>'
	});
	subMessDialog2.ShowDialog();
}
</script>